package com.mhc.suzuki.manager.impl;

import com.mhc.suzuki.bo.AnnexListBO;
import com.mhc.suzuki.dal.mapper.ext.AnnexListExtMapper;
import com.mhc.suzuki.dal.model.AnnexListDO;
import com.mhc.suzuki.dal.query.AnnexListQuery;
import com.mhc.suzuki.manager.AnnexListManager;
import com.subaru.common.query.PageResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;


/**
 * Manager for AnnexList.
 */

@Component
public class AnnexListManagerImpl implements AnnexListManager {


    @Autowired
    protected AnnexListExtMapper annexListExtMapper;

    /**
     * query count by query condition.
     */
    @Override
    public int countByQuery(AnnexListQuery query) {
        return annexListExtMapper.countByQuery(query);
    }

    /**
     * delete by query condition.
     */
    @Override
    public int deleteByQuery(AnnexListQuery query) {
        return annexListExtMapper.deleteByQuery(query);
    }

    /**
     * delete by primary key.
     */
    @Override
    public int deleteByPrimaryKey(AnnexListDO record) {
        return annexListExtMapper.deleteByPrimaryKey(record);
    }

    /**
     * insert selective.
     */
    @Override
    public long insertSelective(AnnexListDO record) {
        return annexListExtMapper.insertSelective(record);
    }

    /**
     * select by query condition.
     */
    @Override
    public List<AnnexListDO> selectByQuery(AnnexListQuery query) {
        return annexListExtMapper.selectByQuery(query);
    }

    /**
     * select by query condition with page.
     */
    @Override
    public PageResult<AnnexListDO> selectByQueryWithPage(AnnexListQuery query) {
        PageResult<AnnexListDO> result = new PageResult<AnnexListDO>();
        result.setPageSize(query.getPageSize());
        result.setPageNo(query.getPageNo());
        result.setTotalCount(this.countByQuery(query));
        result.setResult(this.selectByQuery(query));
        return result;
    }

    /**
     * select by primary key.
     */
    @Override
    public AnnexListDO selectByPrimaryKey(Long id) {
        return annexListExtMapper.selectByPrimaryKey(id);
    }

    /**
     * update by query condition selective.
     */
    @Override
    public int updateByQuerySelective(AnnexListDO record, AnnexListQuery query) {
        return annexListExtMapper.updateByQuerySelective(record, query);
    }

    /**
     * update by query condition.
     */
    @Override
    public int updateByQuery(AnnexListDO record, AnnexListQuery query) {

        return annexListExtMapper.updateByQuery(record, query);
    }

    /**
     * update by primary key selective.
     */
    @Override
    public int updateByPrimaryKeySelective(AnnexListDO record) {
        return annexListExtMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public List<AnnexListBO> selectByAnnexList(Map<String, ?> paramMap) {
        return annexListExtMapper.selectByAnnexList(paramMap);
    }
}